﻿@using VirtualPress.Infrastructure.Entities.Enum;
@using VirtualPress.Infrastructure.Entities.Entity;
@using VirtualPress.Tool.Framework;
@{
    ViewBag.Title = "新增编委会成员 —— 待确认";
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
@section head{
    <link rel="stylesheet" href="/content/css/uniform.css" />
}
<div id="content-header">
    <h1>
        待确认</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/meeting/index" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a href="/WorkSpace/Console/Counsellor">
        人员管理</a> <a href="javascript:" class="current">初审员</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <ul class="nav nav-tabs" style="float:left;">
                        <li><a href="/workspace/meeting/Counsellor">编委会成员</a> </li>
                        <li class="active"><a>待确认</a></li>
                    </ul>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered">
                        <thead>
                            <tr style="cursor: pointer;">
                                <th>
                                    邀请账号
                                </th>
                                <th style="width: 10%">
                                    邀请时间
                                </th>
                                <th style="width: 10%">
                                    角色
                                </th>
                                <th style="width: 10%">
                                    确认状态
                                </th>
                                <th style="width: 30%">
                                    Message
                                </th>
                                <th style="width: 10%"></th>
                            </tr>
                        </thead>
                        <tbody>
                            @{
                                Meeting meeting = ViewBag.Meeting;
                                ItemListBox<Organization> data = ViewBag.Editorial;
                                List<Organization> list = data.Data;}
                            @foreach (var item in list)
                            { 
                                <tr>
                                    <td style="text-align: center">
                                        @item.UserName 
                                    </td>
                                    <td style="text-align: center">
                                        @item.JoinDate.ToString("yyyy-MM-dd")
                                    </td>
                                    <td style="text-align: center">
                                        @Html.Raw(item.Status == JournalStatus.Reviser?"初审员":"编委会") 
                                    </td>
                                    <td style="text-align: center">
                                        @Html.Raw(item.ApplyStatus == 0?"待确认":"已拒绝") 
                                    </td>
                                    <td style="text-align: center">
                                        @Html.Raw(String.IsNullOrEmpty(item.Message)?"暂无":item.Message.PieceOfString(0,20,"......"))
                                    </td>
                                    <td style="text-align:center">
                                    @if (item.ApplyStatus == 0)
                                    {
                                        <a href="javascript:;" onclick="remail(this, '@item.UserName',@meeting.Id)" class="btn btn-primary btn-mini">重发邀请函</a>
                                    }
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
                @Html.Raw(data.PageItemSegment)
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript" src="/scripts/jquery.uniform.js"></script>
    <script type="text/javascript" src="/scripts/select2.min.js"></script>
    <script type="text/javascript" src="/scripts/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="/scripts/unicorn.tables.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likorganization').addClass('open active');
        });
        function remail(sender, username, id) {
            $.ajax({
                url: '/workspace/meeting/remailtoinviteexpert',
                data: {
                    u: username,
                    meeting: id
                },
                success: function () {
                    $(sender).replaceWith($('<span class="label label-success">邀请函已发出</span>'));
                }
            });
        }
    </script>
}
